package cn.baiweigang.uu.enums;

public enum BasisPriceTypeEnum {
    open("open", "开盘价"),
    close("close", "收盘价"),
    high("high", "最高价"),
    low("low", "最低价"),
    average("average", "平均价"),
    ;

    private String code;
    private String desc;

    BasisPriceTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static BasisPriceTypeEnum byCode(String code) {
        BasisPriceTypeEnum[] contractTypeEnums = BasisPriceTypeEnum.values();
        for (int i = 0; i < contractTypeEnums.length; i++) {
            if (contractTypeEnums[i].getCode().equalsIgnoreCase(code)) {
                return contractTypeEnums[i];
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
